<template>
    <div>
       <h1 class="hello">hello-two</h1>
      <span>用户名:{{$route.query.name}}</span>
      <MyButton info="sdfs" @myTest="test"></MyButton>
    </div>
</template>

<script>
  /*引入自定义组件*/
  import MyButton from "../common/MyButton";
    export default {
        name: "Hello_two",
        components:{//设置自定义组件
          MyButton
      },
      methods:{
          test(){
            //alert(1)

          }
      },
        mounted() {
          //获取上一个组件传来的值
          ///var v = this.$route.query.name;
          ///console.log("name="+v);
          //获取共享数据
          var name = this.$store.getters.getName;
          console.log("name="+name);


        }
    }
</script>

<style scoped>

</style>
